<template>
  <div>
  <h1>ref和$refs</h1>
  <h2 ref="title">饶思泳</h2>
  <button @click="getH2">点击</button>

<Demo 
ref="de"/>
<button @click="getDemo">点点滴滴</button>

  </div>
</template>

<script>
import Demo from './components/Demo.vue'
export default {
  
components:{
Demo
},
  data() {
    return {
      
    };
  },

  mounted() {
    
  },

  methods: {
    getH2(){
      console.log(this.$refs.title);
    },
    getDemo(){
      console.log(this.$refs.de);
      console.log(this.$refs.de.msg);
      this.$refs.de.domeFn()
    }
  },
};
</script>

<style >

</style>